// const Dialog = require('@vant/weapp/dialog/index')

Component({
  handleMyEvent(e) {
    // console.log(e.detail)
    console.log('handleMyEvent')
  },

  data: {
    title: 'hello',
    dialogShow: false,
    showOneButtonDialog: false,
    buttons: [{text: '取消'}, {text: '确定'}],
    oneButton: [{text: '确定'}],
    show: false
  },

  methods: {
    handleMyEvent2(e) {
      console.log('handleMyEvent2')
    }
  },

  onReady() {
    const cap = this.selectComponent('#cap')
    // console.dir(cap)
    setTimeout(() => {
      this.setData({
        title: 'hello hello'
      })
    }, 4000)
  },

  handleTap() {
    this.setData({
      dialogShow: true
    })
  },

  handleAlertTap() {

    // this.setData({
    //   show: true
    // })
    // let Dialog = this.selectComponent('#aaa')
    Dialog.alert({
      title: '标题',
      message: '弹窗内容',
    }).then(() => {
      // on close
    });
  }
})